//app.js
App({
  globalData: {
    host: 'http://znsq.yuanjia101.com:5001',  // API接口
    // host: 'http://192.168.1.238:8612',
    // host: 'http://192.168.1.238:50922',
    // host: 'http://zcy.nat123.cc',
    uid: null,  
    token:'',                        // 个人信息
    isLog: function () {
      // 这里的this相当于globalData
      var that = this
      // 同步获取用户信息
     //wx.setStorageSync('token', '');
      var token = wx.getStorageSync('token');
      console.log(that)
      that.token = token;
      console.log(that.token);
      // 登录且绑定过手机号保存用户信息
     console.log(token);
      // 检测用户是否登录，未登录跳转授权页面
      if (token == '' || token == null || token == undefined) {
        wx.redirectTo({
          url: '/pages/accredit/accredit'
        })
        return
      }
    },
    isShow(msg){
      wx.showModal({
        title: '提示',
        content: msg,
        success: function (res) {
          if (res.confirm) {
          } else if (res.cancel) {
          }
        }
      })
    },
    onShow(){
      wx.showShareMenu({
        withShareTicket: true
      })
    }
  }
})